also handle default namespace declarations for unknown elements in the gpx reader.
authortsteven4 <tsteven4@gmail.com>
Tue, 8 Jul 2014 13:13:39 +0000 (13:13 +0000)
committertsteven4 <tsteven4@gmail.com>
Tue, 8 Jul 2014 13:13:39 +0000 (13:13 +0000)
gpsbabel/gpx.cc

index 27760ab29fa314c76427ab4d211f14319714cc1a..5030f33046495d7fdafa2fcd88204c55823f31f0 100644 (file)
@@ -543,7 +543,7 @@ start_something_else(const QString el, const QXmlStreamAttributes& attr)
     avcp++;
   }
   for (int i = 0; i < ns_count; i++)  {
-    *avcp = xstrdup(nsdecl[i].prefix().toString().prepend("xmlns:"));
+    *avcp = xstrdup(nsdecl[i].prefix().toString().prepend(nsdecl[i].prefix().isEmpty()? "xmlns" : "xmlns:"));
     avcp++;
     *avcp = xstrdup(nsdecl[i].namespaceUri().toString());
     avcp++;